import React from 'react';
import {View,Text} from 'react-native';
import Icon from 'react-native-vector-icons/Entypo';
import { SafeAreaView,useSafeAreaInsets } from 'react-native-safe-area-context';
import { useNavigation } from '@react-navigation/native';
// hooks的方式
function SafeViewTest() {
  const insets = useSafeAreaInsets()
  const navigation = useNavigation()
  return (
    <View style={{
      paddingTop:insets.top,
      paddingBottom:insets.bottom,
      flex: 1,
      justifyContent: 'space-between',
      alignItems: 'center',
    }}> 
        
       <Icon name="chevron-left" size={60} color="#41ae3c" />
       <Text onPress={() => navigation.navigate('Home')}> 点我跳转 </Text>
       <Icon name="awareness-ribbon" size={60} color="#ff9900" />
    </View>
  );
  // <SafeAreaView>...</SafeAreaView>
}

export default SafeViewTest;